﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DAL;
using System.Data.SqlClient;

namespace BLL
{
    public class CHITIET_DANHMUCBLL
    {
        DataService DB = new DataService();

        public void insert(int madanhmuc, int maxetnghiem,string ketqua)
        {
            string sql = "insert into chitiet_danhmuc values (@madanhmuc,@maxetnghiem,@ketqua)";

            SqlParameter paraMadm = new SqlParameter("madanhmuc", madanhmuc);
            SqlParameter paraMaxn = new SqlParameter("maxetnghiem", maxetnghiem);
            SqlParameter paraKetqua = new SqlParameter("ketqua", ketqua);

            DB.ExecuteNonQuery(sql, paraMadm, paraMaxn, paraKetqua);
        }

        public void update(int madanhmuc, int maxetnghiem, string ketqua)
        {
            string sql = "update chitiet_danhmuc set ketqua = '" + ketqua + "' where madanhmuc = " + madanhmuc.ToString() + " and maxetnghiem = " + maxetnghiem.ToString();
            DB.ExecuteNonQuery(sql);
        }

        public void delete(int madanhmuc, int maxetnghiem)
        {
            string sql = "delete from chitiet_danhmuc where madanhmuc = " + madanhmuc.ToString() + " and maxetnghiem = " + maxetnghiem.ToString();
            DB.ExecuteNonQuery(sql);
        }
    }
}
